/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.appstreet.domain.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ramesh
 */
@Entity
@Table(name = "serviceplanhistory")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ServicePlanHistory.findAll", query = "SELECT s FROM ServicePlanHistory s"),
    @NamedQuery(name = "ServicePlanHistory.findById", query = "SELECT s FROM ServicePlanHistory s WHERE s.id = :id"),
    @NamedQuery(name = "ServicePlanHistory.findByCreatedOn", query = "SELECT s FROM ServicePlanHistory s WHERE s.createdOn = :createdOn"),
    @NamedQuery(name = "ServicePlanHistory.findByHotLeadPlan", query = "SELECT s FROM ServicePlanHistory s WHERE s.hotLeadPlan = :hotLeadPlan"),
    @NamedQuery(name = "ServicePlanHistory.findByLeadPlan", query = "SELECT s FROM ServicePlanHistory s WHERE s.leadPlan = :leadPlan"),
    @NamedQuery(name = "ServicePlanHistory.findByRequirementsPlan", query = "SELECT s FROM ServicePlanHistory s WHERE s.requirementsPlan = :requirementsPlan")})
public class ServicePlanHistory implements Serializable {
    
    @Id
    @GeneratedValue
    private Long id;
    private Integer leadPlan;
    private Integer hotLeadPlan;
    private Integer requirementsPlan;
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdOn;
    @ManyToOne(cascade= CascadeType.ALL)
    private Company company;

    public ServicePlanHistory() {
    }

    public Integer getHotLeadPlan() {
        return hotLeadPlan;
    }

    public void setHotLeadPlan(Integer hotLeadPlan) {
        this.hotLeadPlan = hotLeadPlan;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getLeadPlan() {
        return leadPlan;
    }

    public void setLeadPlan(Integer leadPlan) {
        this.leadPlan = leadPlan;
    }

    public Integer getRequirementsPlan() {
        return requirementsPlan;
    }

    public void setRequirementsPlan(Integer requirementsPlan) {
        this.requirementsPlan = requirementsPlan;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ServicePlanHistory other = (ServicePlanHistory) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 71 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "ServicePlanHistory{" + "id=" + id + ", leadPlan=" + leadPlan + ", hotLeadPlan=" + hotLeadPlan + ", requirementsPlan=" + requirementsPlan +  '}';
    }

 
}
